package com.beans.aboutIO.aboutBase;

import org.junit.Test;

/**
 * Created by admin on 2017/5/18.
 */
public class BaseChar {

    @Test
    public void displayASCII(){
        String s = "HelloByteBuffer";
        System.out.println(s.codePointAt(0));
        int integer = Integer.valueOf(s.codePointAt(0));
        char c = (char)integer;
        System.out.println(c);
    }

    @Test
    public void buildStr(){
        StringBuilder sb = new StringBuilder();
        for (int i=33;i<=126;i++){
            char a = (char)i;
            sb.append(a);
            System.out.println(i+"\t"+a);
        }
        System.out.println(sb.toString());
        System.out.println("------我是华丽的分割线------");

        StringBuilder sb2 = new StringBuilder();
        for(int j = 128;j<=300;j++){
            char cc = (char)j;
            sb.append(j);
            System.out.println(j+"\t"+cc);
        }
        System.out.println(sb2.toString());
    }

    /**
     * TODO 获取非正常字符
     */
    @Test
    public void testUnusually(){
        String str = "┏"; // TODO 9487
        System.out.println(str.codePointAt(0));
        String str2 = "┠";
        System.out.println(str2.codePointAt(0));
        System.out.println(str2);
        char c = 9504;
        System.out.println(c);
    }
}
